package com.jasmine.bjstkserver.server.article.log.draftlog;

import com.jasmine.bjstkserver.mapper.ArticleDraftLogMapper;
import com.jasmine.bjstkserver.server.article.online.model.ArticleReq;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author jasmineXz
 */
@Service
public class DraftLogServiceImpl implements DraftLogService {
    private static final Logger log = LoggerFactory.getLogger(DraftLogServiceImpl.class);

    @Autowired
    private ArticleDraftLogMapper articleDraftLogMapper;

    @Override
    public List<DraftLogEntity> findList(ArticleReq article) {
        return articleDraftLogMapper.findList(article);
    }

    @Override
    public Integer insert(DraftLogEntity draftLog) {
        log.info("[BJSTK] 记录日志,版本 : {}",draftLog.getVersion());
        return articleDraftLogMapper.insert(draftLog);
    }
}
